package com.haidechizi.designpattern.strategy.extension;

/**
 * @author haidechizi
 */
public class AnalysisHelper {

    public static BarCode analysis(Long vendorId, String itemCode) {
        // 通过数据库获取商家对于的条码解析规则
        String type = "default";
        BarCodeAnalysis analysis = BarCodeFactory.getAnalysis(type);
        return analysis.analysis(itemCode);
    }

    public static void main(String[] args) {
        BarCode barCode = analysis(1L, "5478654214");
        System.out.println(barCode);
    }
}
